import React,{ComponentType} from 'react'
import { useLocation,useParams,useNavigate } from 'react-router-dom';

function widthRoute(Com:ComponentType<any>) {
    return (props:any) =>{
        const  Navigate = useNavigate();
        const  Params = useParams();
        const  Location = useLocation();
        return (
            <Com {...props} routes = {{Navigate,Params,Location}}></Com>
        )
    }
}

export default widthRoute